{% extends 'base.html' %}
{% block content %}
<div class="layui-card">
    <div class="layui-card-header">采集日志</div>
    <div class="layui-card-body">
        <table class="layui-table">
            <thead>
                <tr>
                    <th>时间</th>
                    <th>类型</th>
                    <th>状态</th>
                    <th>数量</th>
                    <th>错误信息</th>
                </tr>
            </thead>
            <tbody>
            {% for log in logs %}
                <tr>
                    <td>{{ log.created_at.strftime('%Y-%m-%d %H:%M:%S') }}</td>
                    <td>{{ log.fund_type }}</td>
                    <td>
                        {% if log.status == 'success' %}
                        <span class="layui-badge layui-bg-green">成功</span>
                        {% else %}
                        <span class="layui-badge">失败</span>
                        {% endif %}
                    </td>
                    <td>{{ log.count }}</td>
                    <td>{{ log.error if log.error else '-' }}</td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
</div>
{% endblock %}